package com.stormrage.entity.edu;

import java.io.Serializable;

/**
 * @Title: EduChapter.java
 * @Package com.stormrage.entity.edu
 * @Description: 章节 Entity 类
 * @author www.stormragetech.com
 * @date 2016年4月8日
 * @version V1.0
 */
public class EduChapter implements Serializable {

	// ------------------------------- Fields -------------------------------

	private static final long serialVersionUID = -987990621709284209L;

	private Integer id;

	private String chapter;

	// ------------------------------- Fields -------------------------------

	public EduChapter() {
	}

	// ------------------------------- Fields -------------------------------

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getChapter() {
		return chapter;
	}

	public void setChapter(String chapter) {
		this.chapter = chapter;
	}

	// ------------------------------- Fields -------------------------------
	
	public static EduChapter instance(String chapter){
		EduChapter entity = new EduChapter();
		entity.setChapter(chapter);
		return entity;
	}

	@Override
	public String toString() {
		return this.getClass() + " : id - " + id + " chapter - " + chapter;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		EduChapter entity = (EduChapter) o;

		if (id != null ? !id.equals(entity.id) : entity.id != null)
			return false;

		return true;
	}

	@Override
	public int hashCode() {
		return id != null ? id.hashCode() : 0;
	}

}
